import express from 'express';
import GrayReleaseController from '../controllers/grayRelease.controller.js';

const router = express.Router();

/**
 * 灰度发布相关路由
 */
router.get('/', GrayReleaseController.getAllGrayReleases);
router.get('/:id', GrayReleaseController.getGrayReleaseById);
router.get('/component-version/:componentVersionId', GrayReleaseController.getGrayReleasesByComponentVersionId);
router.get('/active', GrayReleaseController.getActiveGrayReleases);
router.post('/', GrayReleaseController.createGrayRelease);
router.put('/:id', GrayReleaseController.updateGrayRelease);
router.put('/:id/activate', GrayReleaseController.activateGrayRelease);
router.put('/:id/complete', GrayReleaseController.completeGrayRelease);
router.put('/:id/pause', GrayReleaseController.pauseGrayRelease);
router.delete('/:id', GrayReleaseController.deleteGrayRelease);

export default router;
